﻿
project(ComacMainProgram LANGUAGES CXX)

############################################################
# Create an executable
############################################################


 #输出目录
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_OUTPUT_BIN_DIR})


#所有.ui文件
file(GLOB ALL_UI "*.ui")
#所有.h文件
file(GLOB ALL_HEAD "*.h")
#所有.cpp文件
file(GLOB ALL_SOURCE "*.cpp")

SET(DIR_RESOURCES "${CMAKE_SOURCE_DIR}/Resources")
SET(SRC_QRC_FILES 
    #"${DIR_RESOURCES}/post.rc" 
    "${DIR_RESOURCES}/QUI/light/lightstyle.qrc" 
)

add_executable(${PROJECT_NAME}
    ${ALL_HEAD}
    ${ALL_SOURCE}
    ${ALL_UI}
    ${SRC_QRC_FILES}
)

# 包含头文件目录
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} 
    PRIVATE
    ${CMAKE_SOURCE_DIR}
    ${CMAKE_SOURCE_DIR}/BaseWidget
)


# 配置编译选项
IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
    SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
    SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
ENDIF()    

find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets)


TARGET_LINK_DIRECTORIES(${PROJECT_NAME} PRIVATE ${PROJECT_OUTPUT_BIN_DIR})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} BaseModule BaseWidget)
ADD_DEPENDENCIES(${PROJECT_NAME} BaseModule BaseWidget)

target_link_libraries(${PROJECT_NAME} ${VLD_DIR}/lib/vld.lib)

